print('Введите скобочную последовательность')
txt = input()
while '()' in txt or '[]' in txt or '{}' in txt or'<>' in txt:
    txt = txt.replace('()', '', 1)
    txt = txt.replace('{}', '', 1)
    txt = txt.replace('[]', '', 1)
    txt = txt.replace('<>', '', 1)
if len(txt) == 0:
    print("True")
else:
    print("False")

